<template>
  <div>
    <el-timeline>
      <el-timeline-item v-for="(activity, index) in activities" :key="index" :timestamp="activity.timestamp">
        {{ activity.content }}
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { Getter, Action } from 'vuex-class'
import { ExperienceData } from '@/types/index.ts'
import { getExperience } from '@/utils/getData.ts'
import store from '@/store/index.ts'

@Component
export default class Experience extends Vue {
  @Action public getExper2: any

  private activities: ExperienceData[] = []
  private created() {
    /* getExperience().then((data: ExperienceData[]) => {
      this.activities = data
    }) */
    // 请求后台
    /* store.dispatch('get_experience').then((res: any) => {
      this.activities = res.data
    }) */
    this.getExper2().then((res: any) => {
      this.activities = res
    })
  }
}
</script>

<style lang="stylus" scoped></style>
